package com.jd.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jd.entity.Role;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 角色 Mapper 接口
 * </p>
 *
 * @author wangshuping
 * @since 2021-11-21
 */
public interface RoleMapper extends BaseMapper<Role> {

    @Select("select `code` from t_role tr left join t_user_role tur on tr.id=tur.role_id where tur.user_id=#{userId} and tr.`code`=#{adminRole}")
    String selectRoleCode(@Param("userId")Long userId, @Param("adminRole") String adminRole);
}
